/**
 * Created by fanweihua on 2016/11/18.
 */
import auth from './auth.js';
export default {
  component: require('../../web/app'),
  childRoutes: [
    {
      path: '/',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/LevelSpecification/levelSpecification.js'));
        })
      }
    },
    //层级规范
    {
      path: '/levelSpecification',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/LevelSpecification/levelSpecification.js'))
        })
      }
    },
    //按钮
    {
      path: '/button',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/Form/button/button.js'))
        })
      }
    },
    //表单
    {
      path: '/input',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/Form/input/input.js'))
        })
      }
    },
    //列表
    {
      path: '/list',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/Form/list/list.js'))
        })
      }
    },
    //滑块
    {
      path: '/slider',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/Form/slider/slider.js'))
        })
      }
    },
    //上传组件
    {
      path: '/uploader',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/Form/uploader/uploader.js'))
        })
      }
    },
    //文章
    {
      path: '/article',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/article/article.js'))
        })
      }
    },
    //徽章
    {
      path: '/badge',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/badge/badge.js'))
        })
      }
    },
    //Flex布局
    {
      path: '/flex',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/flex/flex.js'))
        })
      }
    },
    //页脚
    {
      path: '/footer',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/footer/footer.js'))
        })
      }
    },
    //画廊
    {
      path: '/gallery',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/gallery/gallery.js'))
        })
      }
    },
    //九宫格
    {
      path: '/grid',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/grid/grid.js'))
        })
      }
    },
    //图标
    {
      path: '/icons',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/icons/icons.js'))
        })
      }
    },
    //加载更多
    {
      path: '/loadmore',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/loadmore/loadmore.js'))
        })
      }
    },
    //面板
    {
      path: '/panel',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/panel/panel.js'))
        })
      }
    },
    //表单预览
    {
      path: '/preview',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/preview/preview.js'))
        })
      }
    },
    //进度条
    {
      path: '/progress',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/BasicComponent/progress/progress.js'))
        })
      }
    },
    //弹出式菜单
    {
      path: '/actionSheet',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/operationCoupleBack/actionSheet/actionSheet.js'))
        })
      }
    },
    //对话框
    {
      path: '/dialog',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/operationCoupleBack/dialog/dialog.js'))
        })
      }
    },
    //提示页
    {
      path: '/msg',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/operationCoupleBack/msg/msg.js'))
        })
      },
      childRoutes: [
        {
          path: '/msg/msg_success',
          getComponent: (nextState, cb) => {
            require.ensure([], (require) => {
              cb(null, require('../../web/operationCoupleBack/msg/msg_success.js'))
            })
          }
        },
        {
          path: '/msg/msg_warn',
          getComponent: (nextState, cb) => {
            require.ensure([], (require) => {
              cb(null, require('../../web/operationCoupleBack/msg/msg_warn.js'))
            })
          }
        }
      ]
    },
    //多列选择器
    {
      path: '/picker',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/operationCoupleBack/picker/picker.js'))
        });
      }
    },
    //弹出式提示
    {
      path: '/toast',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/operationCoupleBack/toast/toast.js'))
        });
      }
    },
    //导航（上）
    {
      path: '/navbar',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/NavigationCorrelation/navbar/navbar.js'))
        });
      }
    },
    //导航（下）
    {
      path: '/tabbar',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/NavigationCorrelation/tabbar/tabbar.js'))
        });
      }
    },
    //搜索相关
    {
      path: '/searchBar',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/SearchRelated/searchBar/searchBar.js'))
        });
      }
    },
    //
    {
      path: '/ReduxIntro',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/Redux/reduxIntro'))
        });
      }
    },
    {
      path: '/Todo',
      getComponent: (nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('../../web/Redux/Todo'))
        });
      }
    }
  ]
};
function redirectToDashboard(nextState, replace) {
  if (auth.loggedIn()) {
    replace('/')
  }
}